package com.ykdl.member.kid.beans;

import java.io.Serializable;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.ykdl.member.kid.models.FileMetas;

import net.wxxr.http.interfaces.IJsonParser;

public class UserBean implements Serializable, IJsonParser {
	
	/**
	 * "actor_id": 6143,
        "actor_type": 1,
        "baby_profile": {
            "baby_name": "xiaoxiao1",
            "birthday": 1388047495,
            "blood_type": "A",
            "born_height": 22,
            "born_weight": 960,
            "gender": 1,
            "modified_time": 1394158091.254753,
            "user_id": 6143
        },
        "created_time": 1394156333,
        "display_name": "xiaoxiao1",
        "email": "shanpf@7500.com.cn",
        "gender": 0,
        "level": 5,
        "phone": null,
        "profile": {
            "birthday": 1388047495,
            "gender": 0,
            "modified_time": 1394158131.527766,
            "region": "%E5%8C%97%E4%BA%AC",
            "signature": "%E5%8C%97%E4%BA%AC",
            "user_id": 6143
        },
        "total_gold": 20,
        "total_xp": 50,
        "user_id": 6143
	 */
	public static final int RELATION_NONE = 0;// #相互未关注
	public static final int RELATION_FOLLOWED_BY = 1;// #我被关注
	public static final int RELATION_FOLLOWING = 2;// #关注了对方
	public static final int RELATION_FRIENDS = 3;// #相互关注
	
	private int actor_id;
	private int actor_type;
	private BabyProfileBean baby_profile;
	private float create_time;
	private String display_name;
	private String email;
	private int gender;
	private String phone;
	private ProfileBean profile;
	private String total_gold;
	private String total_xp;
	private long user_id;
	private FileMetas avatar_file_meta;
	private int relation;
	private int level;
	
	public int getRelation() {
		return relation;
	}

	public void setRelation(int relation) {
		this.relation = relation;
	}

	public int getActor_id() {
		return actor_id;
	}

	public void setActor_id(int actor_id) {
		this.actor_id = actor_id;
	}

	public int getActor_type() {
		return actor_type;
	}
	
	public BabyProfileBean getBaby_profile() {
		return baby_profile;
	}

	public void setBaby_profile(BabyProfileBean baby_profile) {
		this.baby_profile = baby_profile;
	}

	public void setActor_type(int actor_type) {
		this.actor_type = actor_type;
	}

	public float getCreate_time() {
		return create_time;
	}

	public void setCreate_time(float create_time) {
		this.create_time = create_time;
	}

	public String getDisplay_name() {
		return display_name;
	}

	public void setDisplay_name(String display_name) {
		this.display_name = display_name;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public int getGender() {
		return gender;
	}

	public void setGender(int gender) {
		this.gender = gender;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public ProfileBean getProfile() {
		return profile;
	}

	public void setProfile(ProfileBean profile) {
		this.profile = profile;
	}

	public String getTotal_gold() {
		return total_gold;
	}

	public void setTotal_gold(String total_gold) {
		this.total_gold = total_gold;
	}

	public String getTotal_xp() {
		return total_xp;
	}

	public void setTotal_xp(String total_xp) {
		this.total_xp = total_xp;
	}

	public long getUser_id() {
		return user_id;
	}

	public void setUser_id(long user_id) {
		this.user_id = user_id;
	}
	
	public FileMetas getAvatar_file_meta() {
		return avatar_file_meta;
	}

	public void setAvatar_file_meta(FileMetas avatar_file_meta) {
		this.avatar_file_meta = avatar_file_meta;
	}
	
	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	@Override
	public IJsonParser parse(String json) throws Exception {
		if (json != null) {
			GsonBuilder builder = new GsonBuilder();
			Gson gson = builder.create();
			return gson.fromJson(json, UserBean.class);
		}
		return null;
	}

}
